package com.guigu.aoyun.controller;

import com.guigu.aoyun.entity.Stadia;
import com.guigu.aoyun.service.StadiaService;
import com.guigu.commonutils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/stadia")
@CrossOrigin
public class StadiaController {
    @Autowired
    private StadiaService stadiaService;

    // 查询所有场馆
    @GetMapping
    public R list() {
        List<Stadia> stadiaList = stadiaService.list(null);
        return R.ok().data("stadiaList", stadiaList);
    }
}
